<?php
require_once("../lib/func.autoloader.php");
// login.php
// SuperConstructor login page
// Copyright 2007, Alex McClung
$sc = new SuperConstructor();

// Has POST data been submitted?
if(count($_POST) > 0)
{
	// Did the login fail?
	if(!$sc->logIn($_POST['username'], md5($_POST['pw'])))
	{
		// tell them so
		$sc->assign("login_failed", true);
	}
	// Login succeeded, ship them off to the main menu
	else
		header("Location: {$sc->config->MainMenu}");
}

// Show the login page
$sc->display("admin/pages/login.tpl");
?>